<?php

class LogoutController extends CController
{
	private $_baseSiteUrl  = '/';
	private $_baseLoginUrl = '/admin/login/';
	
	public function actionIndex()
	{
		$auth = UserIdentity::checkAuth();
		
		if ($auth) {
			Yii::app()->user->logout();
			$this->redirect($this->_baseSiteUrl);
		} else {
			$this->redirect($this->_baseLoginUrl);
		}
	}
}